//加载城市列表
$(function(){
  console.log(1);
    //酒店的城市
    ajax({ url:Config.plane.hotelCityList},function (data) {
        var dataInter = data.data;
        city_list = dataInter;
        var interText = doT.template($("#hotel_addr_list").text());
        $("#lists").append(interText(dataInter));
        sort();
    });
});

//选择城市对号√
function hasselected(obj){
    $('.search_city').val(' ');
    var cityName = $(obj).find('div').text();
    $('.search_city').val(cityName);
    // $(obj).siblings().children(".aui-icon-correct").addClass("hidden").removeClass("selected");
    // $(obj).find(".aui-icon-correct").removeClass("hidden").addClass("selected");
}
//传递已选城市
    $("#achieve").click(function () {
        var  city_selected = $(".search_city").val();
        if(city_selected!=null && city_selected!=undefined && city_selected!=''){
            var hotelData = JSON.parse($api.getStorage("hotel_data"));
            hotelData.city_name = city_selected;//选择城市名称
            //hotelData.city_id = $(".aui-iconfont.selected").prev(".num_name").attr('city_id');//城市id
            hotelData.hotel_location = '';//选择城市后清空之前的商业圈和行政区选择
            hotelData.DistrictId        = '';//行政区
            hotelData.BusinessZoneId    = '';//商圈
            $api.setStorage('hotel_data',JSON.stringify(hotelData));
            openWin('index', './index.html');
        }
    });
//获取 url 后的参数值
function getQueryString(key){
    var reg = new RegExp("(^|&)"+key+"=([^&]*)(&|$)");
    var result = window.location.search.substr(1).match(reg);
    return result?decodeURIComponent(result[2]):null;
}
